<?php require_once("includes/security.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>קליניקה נטורופתית</title>
      <?php
	  require("includes/openConnection.php");
if(isset($_POST['מחק'])&& $_POST['מחק'] == 'מחק') 
{
$contactID=$_POST ['contactID'];
$query="DELETE FROM  contact WHERE  id =  '$contactID';";	
if (mysql_query ($query)) 
echo "ההודעה נמחקה בהצלחה";
else echo "היתה בעיה במחיקת ההודעה";
}

require("includes/closeConnection.php");
	  ?>
</head>

<body>
<container id="container">
  <?php require("header.php"); ?>
      <content id="content">
      <contentTitle id="contentTitle">
      קבלת פניות מהצור קשר 
      </contentTitle>
      <contentText id="contentText">
      <p>
      <?php
	  require("includes/openConnection.php");

$result = mysql_query("SELECT * FROM `contact`");

echo "<table border=1>";
while($row = mysql_fetch_array($result))
  {
echo "<form name=form action=# method=post enctype=multipart/form-data>";
echo "<td>מספר הודעה</td>";
echo "<td>".$row['id']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>שם</td>";
echo "<td>".$row['name']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>פלאפון</td>";
echo "<td>".$row['phone']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>מייל</td>";
echo "<td>".$row['email']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td>הערות</td>";
echo "<td>".$row['note']."</td>";
echo "</tr>";
echo "<tr>";
echo "<td><input type=hidden name=contactID value=".$row['id']."></td>";
echo "<td><input type=submit name=מחק value=מחק /></td>";
echo "</tr>";
echo "</form>";

  }
echo "</table>";  
 
require("includes/closeConnection.php");
	  ?>
     </p>
</contentText>
      </content>
</container>
    
    
    
</body>
</html>
